#include <stdio.h>

int main()
{
    int n, k, a;
    int out[100] = {0};  //淘汰的孩子
    int index = 0;       //每轮的起始下标

    scanf("%d %d", &n, &k);

    //幸存的孩子
    int child_num[100] = {0};
    for(int i = 0; i < n; i++){
        child_num[i] = i+1;
    }

    //每轮淘汰情况，并更新变量
    for(int i = 0; i < k; i++){
        scanf("%d", &a);

        index = (index+a)%n;        //被淘汰的下标
        out[i] = child_num[index];
        n -= 1;
        for(int j = index; j < k; j++){
            child_num[j] = child_num[j+1];
        }
    }

    for(int i = 0; i < k; i++){
        printf("%d ", out[i]);
    }
    printf("\n");

    return 0;
}
